abstract class Catalog {
    String code
    String name

    static constraints = {
        code(blank: false, unique: true)
        name(blank: false, unique: true)
    }

    static mapping = {
        tablePerHierarchy: false
    }

    public String toString() {
        return "[$code] $name"
    }

    public boolean equals(Object other) {
        if (other == null) return false

        return code == other.code
    }
}
